//
//  RBFootBallGameViewCell.m
//  RMMaterialRed
//
//  Created by XBWH on 2024/3/12.
//

#import "RBFootBallGameViewCell.h"
#import "RBCompeRecommendModel.h"

@interface RBFootBallGameViewCell ()
@property(strong,nonatomic)UIView *bgView;
@property(strong,nonatomic)UILabel *compTitleLabel;
@property(strong,nonatomic)UILabel *timeLabel;
@property(strong,nonatomic)UILabel *statueLabel;
@property(strong,nonatomic)UILabel *typeScoreLabel;
@property(strong,nonatomic)UILabel *typeLabel;
@property(strong,nonatomic)UIImageView *homeImageView;
@property(strong,nonatomic)UILabel *homeTeamLabel;
@property(strong,nonatomic)UILabel *homeRedLabel;
@property(strong,nonatomic)UILabel *homeYellowLabel;
@property(strong,nonatomic)UILabel *homeScoreLabel;
@property(strong,nonatomic)UILabel *vsLabel;
@property(strong,nonatomic)UIImageView *awayImageView;
@property(strong,nonatomic)UILabel *awayTeamLabel;
@property(strong,nonatomic)UILabel *awayRedLabel;
@property(strong,nonatomic)UILabel *awayYellowLabel;
@property(strong,nonatomic)UILabel *awayScoreLabel;
@property(strong,nonatomic)UIButton *collectButton;
@property(strong,nonatomic)UIView *optionView;
@property(strong,nonatomic)UIImageView *optionImageView;
@property(strong,nonatomic)UILabel *optionLabel;
@property(strong,nonatomic)UIView *lineView;
@end

@implementation RBFootBallGameViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self rb_initViewUI];
        [self setNeedsLayout];
    }
    return self;
}
-(void)rb_initViewUI{
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    [self.contentView addSubview:self.bgView];
    [self.bgView addSubview:self.compTitleLabel];
    [self.bgView addSubview:self.typeLabel];
    [self.bgView addSubview:self.timeLabel];
    [self.bgView addSubview:self.typeScoreLabel];
    [self.bgView addSubview:self.optionView];
    [self.optionView addSubview:self.optionImageView];
    [self.optionView addSubview:self.optionLabel];
    [self.bgView addSubview:self.homeImageView];
    [self.bgView addSubview:self.homeTeamLabel];
    [self.bgView addSubview:self.homeRedLabel];
    [self.bgView addSubview:self.homeYellowLabel];
    [self.bgView addSubview:self.homeScoreLabel];
    [self.bgView addSubview:self.vsLabel];
    [self.bgView addSubview:self.awayImageView];
    [self.bgView addSubview:self.awayTeamLabel];
    [self.bgView addSubview:self.awayRedLabel];
    [self.bgView addSubview:self.awayYellowLabel];
    [self.bgView addSubview:self.awayScoreLabel];
    [self.bgView addSubview:self.collectButton];
    [self.bgView addSubview:self.statueLabel];
    [self.bgView addSubview:self.lineView];
    
    [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.bottom.mas_equalTo(0);
    }];
    [self.compTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(RBScaleWidth(10));
        make.left.mas_equalTo(RBScaleWidth(10));
        make.height.mas_equalTo(RBScaleWidth(10));
    }];
    [self.typeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.compTitleLabel.mas_right).mas_offset(RBScaleWidth(10));
        make.centerY.mas_equalTo(self.compTitleLabel.mas_centerY);
    }];
    [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.compTitleLabel.mas_bottom).mas_offset(RBScaleWidth(12));
        make.left.mas_equalTo(self.compTitleLabel.mas_left);
        make.height.mas_equalTo(RBScaleWidth(11));
    }];
    [self.typeScoreLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.timeLabel.mas_bottom).mas_offset(RBScaleWidth(7));
        make.left.mas_equalTo(self.compTitleLabel.mas_left);
        make.height.mas_equalTo(RBScaleWidth(11));
    }];
    [self.optionView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.typeScoreLabel.mas_bottom).mas_offset(RBScaleWidth(7));
        make.left.mas_equalTo(self.compTitleLabel.mas_left);
        make.width.mas_equalTo(0);
        make.height.mas_equalTo(RBScaleWidth(16));
    }];
    self.optionView.layer.cornerRadius = 2;
    self.optionView.layer.masksToBounds = YES;
    self.optionView.layer.borderColor = RBColor(255, 0, 0).CGColor;
    self.optionView.layer.borderWidth = 1;
    [self.optionImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.bottom.mas_equalTo(0);
        make.width.mas_equalTo(RBScaleWidth(29));
    }];
    [self.optionLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.right.bottom.mas_equalTo(0);
        make.left.mas_equalTo(self.optionImageView.mas_right);
    }];
    [self.homeImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.compTitleLabel.mas_bottom).mas_offset(RBScaleWidth(10));
        make.left.mas_equalTo(self.timeLabel.mas_right).mas_offset(RBScaleWidth(20));
        make.width.height.mas_equalTo(RBScaleWidth(24));
    }];
    self.homeImageView.clipsToBounds = YES;
    [self.homeTeamLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.homeImageView.mas_right).mas_offset(RBScaleWidth(10));
        make.centerY.mas_equalTo(self.homeImageView.mas_centerY);
    }];
    [self.homeYellowLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.homeTeamLabel.mas_right).mas_offset(RBScaleWidth(5));
        make.centerY.mas_equalTo(self.homeTeamLabel.mas_centerY);
        make.width.mas_equalTo(RBScaleWidth(8));
    }];
    [self.homeRedLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.homeYellowLabel.mas_right).mas_offset(RBScaleWidth(4));
        make.centerY.mas_equalTo(self.homeTeamLabel.mas_centerY);
        make.width.mas_equalTo(RBScaleWidth(8));
    }];
    [self.homeScoreLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.homeTeamLabel.mas_centerY);
        make.right.mas_equalTo(-RBScaleWidth(68));
    }];
    [self.awayImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.homeImageView.mas_bottom).mas_offset(RBScaleWidth(10));
        make.left.mas_equalTo(self.homeImageView.mas_left);
        make.width.height.mas_equalTo(RBScaleWidth(24));
    }];
    self.awayImageView.clipsToBounds = YES;
    [self.awayTeamLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.homeTeamLabel.mas_left);
        make.centerY.mas_equalTo(self.awayImageView.mas_centerY);
    }];
    [self.awayYellowLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.awayTeamLabel.mas_right).mas_offset(RBScaleWidth(5));
        make.centerY.mas_equalTo(self.awayTeamLabel.mas_centerY);
        make.width.mas_equalTo(RBScaleWidth(9));
    }];
    [self.awayRedLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.awayYellowLabel.mas_right).mas_offset(RBScaleWidth(4));
        make.centerY.mas_equalTo(self.awayTeamLabel.mas_centerY);
        make.width.mas_equalTo(RBScaleWidth(9));
    }];
    [self.awayScoreLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.awayTeamLabel.mas_centerY);
        make.right.mas_equalTo(-RBScaleWidth(68));
    }];
    [self.vsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-RBScaleWidth(68));
        make.centerY.mas_equalTo(self.bgView.mas_centerY).mas_equalTo(RBScaleWidth(8));
    }];
    [self.collectButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(0);
        make.right.mas_equalTo(-RBScaleWidth(19));
        make.width.height.mas_equalTo(RBScaleWidth(20));
    }];
    [self.statueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.collectButton.mas_bottom).mas_offset(RBScaleWidth(7));
        make.centerX.mas_equalTo(self.collectButton.mas_centerX);
    }];
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.mas_equalTo(0);
        make.height.mas_equalTo(0.5);
    }];
}
- (void)setModel:(RBCompeRecommendModel *)model{
    _model = model;
    self.compTitleLabel.text = model.shortNameZh;
    NSString *month = model.matchTime.rb_newFormatMMdd;
    NSString *time = model.matchTime.rb_format_HH_mm;
    self.timeLabel.text = [NSString stringWithFormat:@"%@ %@",month,time];
    self.homeTeamLabel.text = model.homeNameZh;
    self.awayTeamLabel.text = model.awayNameZh;
    [self.homeImageView sd_setImageWithURL:[NSURL URLWithString:model.homeLogo] placeholderImage:[UIImage imageNamed:@""]];
    [self.awayImageView sd_setImageWithURL:[NSURL URLWithString:model.awayLogo] placeholderImage:[UIImage imageNamed:@""]];
    if([model.bdNum integerValue]>0 && [model.jcNum integerValue]>0){
        NSString *weekStr = [model.jcNum substringToIndex:1];
        weekStr = [NSString rb_NSStringReplaceWeekDay:weekStr];
        NSString *ciStr = [model.jcNum substringFromIndex:1];
        self.typeLabel.text = [NSString stringWithFormat:@"%@%@",weekStr,ciStr];
    }else{
        if([model.bdNum integerValue]>0){
            self.typeLabel.text = [NSString stringWithFormat:@"北单%@",model.bdNum];
        }else{
            if([model.jcNum integerValue]>0){
                NSString *weekStr = [model.jcNum substringToIndex:1];
                weekStr = [NSString rb_NSStringReplaceWeekDay:weekStr];
                NSString *ciStr = [model.jcNum substringFromIndex:1];
                self.typeLabel.text = [NSString stringWithFormat:@"%@%@",weekStr,ciStr];
            }else{
                self.typeLabel.text = @"";
            }
        }
    }
    NSArray *homeSrcoreArr = [model.homeScores mj_JSONObject];
    NSArray *awaySrcoreArr = [model.awayScores mj_JSONObject];
    if (homeSrcoreArr.count==7 && awaySrcoreArr.count==7) {
        if ([homeSrcoreArr[2] intValue] == 0) {
            self.homeRedLabel.hidden = YES;
            self.homeRedLabel.text = @"";
            [self.homeRedLabel mas_updateConstraints:^(MASConstraintMaker *make) {
                make.left.mas_equalTo(self.homeYellowLabel.mas_right).mas_offset(0);
                make.width.mas_equalTo(0);
            }];
        }else{
            self.homeRedLabel.hidden = NO;
            self.homeRedLabel.text = [NSString stringWithFormat:@"%@ ",homeSrcoreArr[2]];
            [self.homeRedLabel mas_updateConstraints:^(MASConstraintMaker *make) {
                make.left.mas_equalTo(self.homeYellowLabel.mas_right).mas_offset(RBScaleWidth(4));
                make.width.mas_equalTo(RBScaleWidth(8));
            }];
        }
        if ([homeSrcoreArr[3] intValue] == 0) {
            self.homeYellowLabel.hidden = YES;
            self.homeYellowLabel.text = @"";
            [self.homeYellowLabel mas_updateConstraints:^(MASConstraintMaker *make) {
                make.left.mas_equalTo(self.homeTeamLabel.mas_right).mas_offset(0);
                make.width.mas_equalTo(0);
            }];
        }else{
            self.homeYellowLabel.hidden = NO;
            self.homeYellowLabel.text = [NSString stringWithFormat:@"%@ ",homeSrcoreArr[3]];
            [self.homeYellowLabel mas_updateConstraints:^(MASConstraintMaker *make) {
                make.left.mas_equalTo(self.homeTeamLabel.mas_right).mas_offset(RBScaleWidth(5));
                make.width.mas_equalTo(RBScaleWidth(9));
            }];
        }
        if ([awaySrcoreArr[2] intValue] == 0) {
            self.awayRedLabel.hidden = YES;
            self.awayRedLabel.text = @"";
            [self.awayRedLabel mas_updateConstraints:^(MASConstraintMaker *make) {
                make.left.mas_equalTo(self.awayYellowLabel.mas_right).mas_offset(0);
                make.width.mas_equalTo(0);
            }];
        }else{
            self.awayRedLabel.hidden = NO;
            self.awayRedLabel.text = [NSString stringWithFormat:@"%@ ",awaySrcoreArr[2]];
            [self.awayRedLabel mas_updateConstraints:^(MASConstraintMaker *make) {
                make.left.mas_equalTo(self.awayYellowLabel.mas_right).mas_offset(RBScaleWidth(4));
                make.width.mas_equalTo(RBScaleWidth(9));
            }];
        }
        if ([awaySrcoreArr[3] intValue] == 0) {
            self.awayYellowLabel.hidden = YES;
            self.awayYellowLabel.text = @"";
            [self.awayYellowLabel mas_updateConstraints:^(MASConstraintMaker *make) {
                make.left.mas_equalTo(self.awayTeamLabel.mas_right).mas_offset(0);
                make.width.mas_equalTo(0);
            }];
        }else{
            self.awayYellowLabel.hidden = NO;
            self.awayYellowLabel.text = [NSString stringWithFormat:@"%@ ",awaySrcoreArr[3]];
            [self.awayYellowLabel mas_updateConstraints:^(MASConstraintMaker *make) {
                make.left.mas_equalTo(self.awayTeamLabel.mas_right).mas_offset(RBScaleWidth(5));
                make.width.mas_equalTo(RBScaleWidth(9));
            }];
        }
    }
    switch ([model.statusId intValue]) {
        case 1:
            self.statueLabel.text = @" 未开赛 ";
            break;
        case 2:
            self.statueLabel.text = @" 上半场 ";
            self.statueLabel.text = @" 进行中 ";
            break;
        case 3:
            self.statueLabel.text = @"中场";
            self.statueLabel.text = @" 进行中 ";
            break;
        case 4:
            self.statueLabel.text = @" 下半场 ";
            self.statueLabel.text = @" 进行中 ";
            break;
        case 5:
            self.statueLabel.text = @" 加时赛 ";
            self.statueLabel.text = @" 进行中 ";
            break;
        case 6:
            self.statueLabel.text = @" 加时赛(弃用) ";
            break;
        case 7:
            self.statueLabel.text = @" 点球决战 ";
            break;
        case 8:
            self.statueLabel.text = @" 完场 ";
            break;
        case 9:
            self.statueLabel.text = @" 推迟 ";
            break;
        case 10:
            self.statueLabel.text = @" 中断 ";
            break;
        case 11:
            self.statueLabel.text = @" 腰斩 ";
            break;
        case 12:
            self.statueLabel.text = @" 取消 ";
            break;
        case 13:
            self.statueLabel.text = @" 待定 ";
            break;
        default:
            self.statueLabel.text = @" 比赛异常 ";
            break;
    }
    
    if([self.statueLabel.text containsString:@"完场"] || [self.statueLabel.text containsString:@"进行中"]){
        if (homeSrcoreArr.count > 0 && awaySrcoreArr.count > 0) {
            self.vsLabel.hidden = YES;
            self.homeScoreLabel.hidden = NO;
            self.awayScoreLabel.hidden = NO;
            self.homeScoreLabel.text = [NSString stringWithFormat:@"%@",homeSrcoreArr[0]];
            self.awayScoreLabel.text = [NSString stringWithFormat:@"%@",awaySrcoreArr[0]];
        }else{
            self.vsLabel.hidden = NO;
            self.homeScoreLabel.hidden = YES;
            self.awayScoreLabel.hidden = YES;
            self.vsLabel.text = @"VS";
        }
    }else{
        self.vsLabel.hidden = NO;
        self.homeScoreLabel.hidden = YES;
        self.awayScoreLabel.hidden = YES;
        self.vsLabel.text = @"VS";
    }
    if([self.statueLabel.text containsString:@"完场"]|| [self.statueLabel.text containsString:@"进行中"]){
        self.typeScoreLabel.hidden = NO;
        if([model.statusId intValue]>2 && [model.statusId intValue]<9){
            self.typeScoreLabel.text = [NSString stringWithFormat:@"半%@:%@ 角%@:%@",homeSrcoreArr[1],awaySrcoreArr[1],homeSrcoreArr[4],awaySrcoreArr[4]];
        }else{
            self.typeScoreLabel.text = [NSString stringWithFormat:@"角%@:%@",homeSrcoreArr[4],awaySrcoreArr[4]];
        }
        [self.statueLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.right.mas_equalTo(-RBScaleWidth(10));
            make.centerY.mas_equalTo(self.vsLabel.mas_centerY);
        }];
    }else{
        self.typeScoreLabel.hidden = YES;
        self.typeScoreLabel.text = @"";
        [self.statueLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.collectButton.mas_bottom).mas_offset(RBScaleWidth(7));
            make.centerX.mas_equalTo(self.collectButton.mas_centerX);
        }];
    }
    if([self.statueLabel.text containsString:@"进行中"]){
        self.statueLabel.textColor = RBColor(242, 48, 48);
        self.vsLabel.textColor = RBColor(242, 48, 48);
        self.homeScoreLabel.textColor = RBColor(242, 48, 48);
        self.awayScoreLabel.textColor = RBColor(242, 48, 48);
    }else if([self.statueLabel.text containsString:@"完场"]){
        self.statueLabel.textColor = RBColor(153, 153, 153);
        self.vsLabel.textColor = RBColor(51, 51, 51);
        self.homeScoreLabel.textColor = RBColor(51, 51, 51);
        self.awayScoreLabel.textColor = RBColor(51, 51, 51);
    }else{
        self.statueLabel.textColor = RBColor(51, 51, 51);
        self.vsLabel.textColor = RBColor(51, 51, 51);
        self.homeScoreLabel.textColor = RBColor(51, 51, 51);
        self.awayScoreLabel.textColor = RBColor(51, 51, 51);
    }
    
    if([self.statueLabel.text containsString:@"未开赛"]||[self.statueLabel.text containsString:@"延期"]){
        self.collectButton.hidden = NO;
    }else{
        self.collectButton.hidden = YES;
    }
    if ([model.followStatus integerValue] == 1) {
        [_collectButton setImage:[UIImage imageNamed:@"yscc"] forState:UIControlStateNormal];
    }else{
        [_collectButton setImage:[UIImage imageNamed:@"wsc"] forState:UIControlStateNormal];
    }
    if ([model.articleNum integerValue] > 0) {
        self.optionView.hidden = NO;
        self.optionLabel.text = [NSString stringWithFormat:@"%@",model.articleNum];
        CGFloat width = [self.optionLabel.text rb_sizeWithFont:RBPingFangMediumFont(10) constrainedToHeight:RBScaleWidth(16)].width+RBScaleWidth(5)+RBScaleWidth(5);
        [self.optionLabel mas_updateConstraints:^(MASConstraintMaker *make) {
            make.width.mas_equalTo(width);
        }];
        CGFloat optionViewW = RBScaleWidth(29)+width;
        [self.optionView mas_updateConstraints:^(MASConstraintMaker *make) {
            make.width.mas_equalTo(optionViewW);
        }];
    } else {
        self.optionView.hidden = YES;
        self.optionLabel.text = @"";
        [self.optionView mas_updateConstraints:^(MASConstraintMaker *make) {
            make.width.mas_equalTo(0);
        }];
    }
    //既有角球又有料
    if ([model.articleNum integerValue]>0&&![RBTool rb_isEmptyStr:self.typeScoreLabel.text]) {
        [self.timeLabel mas_updateConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.compTitleLabel.mas_bottom).mas_offset(RBScaleWidth(12));
        }];
        [self.typeScoreLabel mas_updateConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.timeLabel.mas_bottom).mas_offset(RBScaleWidth(7));
            make.height.mas_equalTo(RBScaleWidth(11));
        }];
    } else if([model.articleNum integerValue]>0||![RBTool rb_isEmptyStr:self.typeScoreLabel.text]) {
        [self.timeLabel mas_updateConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.compTitleLabel.mas_bottom).mas_offset(RBScaleWidth(22));
        }];
        if (![RBTool rb_isEmptyStr:self.typeScoreLabel.text]) {
            [self.typeScoreLabel mas_updateConstraints:^(MASConstraintMaker *make) {
                make.top.mas_equalTo(self.timeLabel.mas_bottom).mas_offset(RBScaleWidth(7));
                make.height.mas_equalTo(RBScaleWidth(11));
            }];
        }else{
            [self.typeScoreLabel mas_updateConstraints:^(MASConstraintMaker *make) {
                make.top.mas_equalTo(self.timeLabel.mas_bottom).mas_offset(0);
                make.height.mas_equalTo(0);
            }];
        }
    }else{
        [self.timeLabel mas_updateConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.compTitleLabel.mas_bottom).mas_offset(RBScaleWidth(34));
        }];
    }
    
    [self layoutIfNeeded];
}
-(void)collectButtonTap:(UIButton *)collectButton{
    if (self.collectButtonTapBlock) {
        self.collectButtonTapBlock(_model);
    }
}
- (UIView *)bgView{
    if(_bgView==nil){
        _bgView = [[UIView alloc] init];
        _bgView.backgroundColor = [UIColor whiteColor];
    }
    return _bgView;
}

-(UILabel *)compTitleLabel{
    if(_compTitleLabel==nil){
        _compTitleLabel = [UILabel rb_labelWithTitle:@"比赛" color:RBColor(102, 102, 102) font:RBPingFangFont(11) alignment:NSTextAlignmentLeft];
    }
    return _compTitleLabel;
}
-(UILabel *)timeLabel{
    if(_timeLabel==nil){
        _timeLabel = [UILabel rb_labelWithTitle:@"08:00" color:RBColor(51, 51, 51) font:RBPingFangMediumFont(13) alignment:NSTextAlignmentLeft];
    }
    return _timeLabel;
}
-(UILabel *)statueLabel{
    if(_statueLabel==nil){
        _statueLabel = [UILabel rb_labelWithTitle:@"未开赛" color:RBColor(51, 51, 51) font:RBPingFangMediumFont(13) alignment:NSTextAlignmentCenter];
    }
    return _statueLabel;
}
-(UILabel *)typeScoreLabel{
    if(_typeScoreLabel==nil){
        _typeScoreLabel = [UILabel rb_labelWithTitle:@"半1:0 角8:2" color:RBColor(153, 153, 153) font:RBPingFangFont(11) alignment:NSTextAlignmentLeft];
    }
    return _typeScoreLabel;
}
-(UILabel *)typeLabel{
    if(_typeLabel==nil){
        _typeLabel = [UILabel rb_labelWithTitle:@"北单15" color:RBColor(102, 102, 102) font:RBPingFangFont(11) alignment:NSTextAlignmentLeft];
    }
    return _typeLabel;
}
- (UIImageView *)homeImageView{
    if(_homeImageView==nil){
        _homeImageView = [[UIImageView alloc] init];
        _homeImageView.image = [UIImage imageNamed:@""];
        _homeImageView.contentMode = UIViewContentModeScaleAspectFit;
    }
    return _homeImageView;
}
-(UILabel *)homeTeamLabel{
    if(_homeTeamLabel==nil){
        _homeTeamLabel = [UILabel rb_labelWithTitle:@"足球" color:RBColor(51, 51, 51) font:RBPingFangMediumFont(14) alignment:NSTextAlignmentLeft];
    }
    return _homeTeamLabel;
}
-(UILabel *)homeRedLabel{
    if(_homeRedLabel==nil){
        _homeRedLabel = [UILabel rb_labelWithTitle:@"0" color:RBColor(255, 255, 255) font:RBPingFangFont(11) alignment:NSTextAlignmentCenter];
        _homeRedLabel.backgroundColor = RBColor(242, 48, 48);
        _homeRedLabel.hidden = YES;
    }
    return _homeRedLabel;
}
-(UILabel *)homeYellowLabel{
    if(_homeYellowLabel==nil){
        _homeYellowLabel = [UILabel rb_labelWithTitle:@"0" color:RBColor(255, 255, 255) font:RBPingFangFont(11) alignment:NSTextAlignmentCenter];
        _homeYellowLabel.backgroundColor = RBColor(255, 174, 0);
        _homeYellowLabel.hidden = YES;
    }
    return _homeYellowLabel;
}
-(UILabel *)homeScoreLabel{
    if(_homeScoreLabel==nil){
        _homeScoreLabel = [UILabel rb_labelWithTitle:@"0" color:RBColor(242, 48, 48) font:RBPingFangMediumFont(16) alignment:NSTextAlignmentRight];
    }
    return _homeScoreLabel;
}
-(UILabel *)vsLabel{
    if(_vsLabel==nil){
        _vsLabel = [UILabel rb_labelWithTitle:@"VS" color:RBColor(51, 51, 51) font:RBPingFangMediumFont(15) alignment:NSTextAlignmentRight];
    }
    return _vsLabel;
}
- (UIImageView *)awayImageView{
    if(_awayImageView==nil){
        _awayImageView = [[UIImageView alloc] init];
        _awayImageView.image = [UIImage imageNamed:@""];
        _awayImageView.contentMode = UIViewContentModeScaleAspectFit;
    }
    return _awayImageView;
}
-(UILabel *)awayTeamLabel{
    if(_awayTeamLabel==nil){
        _awayTeamLabel = [UILabel rb_labelWithTitle:@"足球" color:RBColor(51, 51, 51) font:RBPingFangMediumFont(14) alignment:NSTextAlignmentLeft];
    }
    return _awayTeamLabel;
}
-(UILabel *)awayRedLabel{
    if(_awayRedLabel==nil){
        _awayRedLabel = [UILabel rb_labelWithTitle:@"0" color:RBColor(255, 255, 255) font:RBPingFangFont(11) alignment:NSTextAlignmentCenter];
        _awayRedLabel.backgroundColor = RBColor(242, 48, 48);
        _awayRedLabel.hidden = YES;
    }
    return _awayRedLabel;
}
-(UILabel *)awayYellowLabel{
    if(_awayYellowLabel==nil){
        _awayYellowLabel = [UILabel rb_labelWithTitle:@"0" color:RBColor(255, 255, 255) font:RBPingFangFont(11) alignment:NSTextAlignmentCenter];
        _awayYellowLabel.backgroundColor = RBColor(255, 174, 0);
        _awayYellowLabel.hidden = YES;
    }
    return _awayYellowLabel;
}
-(UILabel *)awayScoreLabel{
    if(_awayScoreLabel==nil){
        _awayScoreLabel = [UILabel rb_labelWithTitle:@"0" color:RBColor(242, 48, 48) font:RBPingFangMediumFont(16) alignment:NSTextAlignmentRight];
    }
    return _awayScoreLabel;
}
- (UIButton *)collectButton{
    if(_collectButton==nil){
        _collectButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [_collectButton setImage:[UIImage imageNamed:@"wsc"] forState:UIControlStateNormal];
        [_collectButton addTarget:self action:@selector(collectButtonTap:) forControlEvents:UIControlEventTouchUpInside];
        _collectButton.hidden = YES;
    }
    return _collectButton;
}
-(UIView *)optionView{
    if (_optionView==nil) {
        _optionView = [[UIView alloc] init];
        _optionView.hidden = YES;
    }
    return _optionView;
}
- (UIImageView *)optionImageView{
    if(_optionImageView==nil){
        _optionImageView = [[UIImageView alloc] init];
        _optionImageView.image = [UIImage imageNamed:@"fa"];
        _optionImageView.contentMode = UIViewContentModeScaleAspectFill;
    }
    return _optionImageView;
}
-(UILabel *)optionLabel{
    if(_optionLabel==nil){
        _optionLabel = [UILabel rb_labelWithTitle:@"3" color:RBColor(255, 106, 0) font:RBPingFangMediumFont(10) alignment:NSTextAlignmentCenter];
    }
    return _optionLabel;
}
- (UIView *)lineView{
    if(_lineView==nil){
        _lineView = [[UIView alloc] init];
        _lineView.backgroundColor = RBColor(237, 237, 237);
    }
    return _lineView;
}

@end
